<template>
	<view class="box">
		
			<uni-icons class='top' type="contact-filled" size="80"></uni-icons>
			<button   class="main" type="primary" @click="getUserProfile">一键登录</button>
			 <text class="bottom">登录后享受更多权益</text>
	</view>
</template>

<script>
	export default {
		data() {
			return {
			
			};
		},
		methods:{
			getUserProfile(){
				var value=false
				 uni.getUserProfile({
				      desc: '用于完善会员资料', // 声明获取用户个人信息后的用途，后续会展示在弹窗中，请谨慎填写
				      success: (res) => {
						  uni.setStorageSync("userInfo",res)	  
						  uni.$Store.commit("pssInfo",res)
						  this.skipTab()
				      },
					  fail:(err)=>{
						uni.$showMsg("授权失败")
					  }
				    })
			},
			skipTab(){
				if(JSON.stringify(uni.$Store.state.cartdata.skip)!=='{}'){
										
											 uni.switchTab({
											 	url:uni.$Store.state.cartdata.skip.from,
											 	success: () => {
                                                   uni.removeStorageSync("skip")
											 	},
												
												
											 })
				}
			}
			
		}
	}
</script>

<style lang="scss">
   .box{
	   display:flex;
	   height:750rpx;
	   flex-direction:column;
	   justify-content:center;
	   align-items: center;
	   background-color: #F8F8F8;
	   overflow: hidden;
	   .main{
		   width:90%;
		   background-color:#c00000;
		   margin: 15px 0;
	   }
	   .bottom{
		   font-size: 14px;
		   color: #C0C0C0;
	   }
	   &::after{
		   display:block;
		   content: "";
		   width: 100%;
		   height: 90px;
		   border-radius: 100%;
		   background-color:#fff;
		    
		   transform: translateY(100%);
	   }
   }
</style>
